package com.company.demo.factory_pattern;

public class Calculator {
    double numberA;
    double numberB;
    Operater operater = null;

    public void setOperaterNumber(double numberA, double numberB) {
        this.numberA = numberA;
        this.numberB = numberB;
    }

    void setOperater(Operater operater) {
        this.operater = operater;
    }

    double getResult() {
        if (operater != null) {
            return operater.operater(numberA, numberB);
        }
        return 0;
    }


}
